<template>
	<scroll-view class="scroll-y" scroll-y>
		<view class="container">
			<!-- 头部 -->
			<view class="my-heager">
				<!-- 切换城市名称 -->
				<view class="city">
					<image src="../../static/微信图片_20240805083439.jpg" mode="" @tap="PagetoPrivate"></image>
					<text  @click="PagetoCity">{{city}}</text>
					<image src="../../static/sanjioa.png" mode=""></image>
				</view>
				<!-- 右边的扫一扫 -->
				<view class="sao"  @click="scanCode">
					<image src="../../static/soayisao.png" mode=""></image>
				</view>
			</view>
			<view class="second">
				<!-- 地图 -->
				<view class="map">
					<image src="../../static/定位.png" mode=""></image>
				</view>
				<!-- 搜索栏 -->
				<view class="seach">
					<!-- 进入导览 -->
					<view class="jinru" @tap="toSousuoPage">
						<image src="../../static/点.png" mode=""></image>
						<text style="font-weight: 900;">您要去的景区</text>
					</view>
					<view class="du">
					</view>
				</view>
			</view>
			<!-- 宫格 -->
			<view>
				<u-grid :border="false" col="4">
					<u-grid-item v-for="(listItem,listIndex) in list" :key="listIndex">
						<u-icon :customStyle="{paddingTop:20+'rpx'}" :name="listItem.name" :size="22"></u-icon>
						<text class="grid-text">{{listItem.title}}</text>
					</u-grid-item>
				</u-grid>
				<u-toast ref="uToast" />
			</view>
			<view class="" style="margin-top:10px ;">
				<!-- 轮播图 -->
				<u-swiper class="swiper" :list="list3" indicator autoplay interval="2000" circular></u-swiper>
			</view>
			<!-- 文字 -->
			<view class="jingdian">
				<view class="j-left">
					<text>景点游玩</text>
				</view>
				<view class="j-right">
					<text>手绘地图</text>
					<text>距离</text>
					<text>热度</text>
				</view>
			</view>
			<!-- 景点 -->
			<view class="list-jingdian" @tap="pagetomap">
				<view class="box">
					<image src="../../static/微信图片_20240805143422.jpg" mode=""></image>
				</view>
				<view class="box2">
					<text style="font-weight: 900;">东江湖风景区</text>
					<view>
						<text style="font-size: 10px;">长沙市宁乡县黄材镇黄材大道</text>
					</view>
					<view class="boxx">
						<text style="font-size: 12px;">自然风光</text>
					</view>
					<view class="">
						<text style="font-size: 10px;">据您2.1km</text>
					</view>
				</view>
			</view>
			<!-- 景点 -->
			<view class="list-jingdian" @tap="pagetomap">
				<view class="box">
					<image src="../../static/微信图片_20240805143422.jpg" mode=""></image>
				</view>
				<view class="box2">
					<text style="font-weight: 900;">东江湖风景区</text>
					<view>
						<text style="font-size: 10px;">长沙市宁乡县黄材镇黄材大道</text>
					</view>
					<view class="boxx">
						<text style="font-size: 12px;">自然风光</text>
					</view>
					<view class="">
						<text style="font-size: 10px;">据您2.1km</text>
					</view>
				</view>
			</view>
			<!-- 景点 -->
			<view class="list-jingdian" @tap="pagetomap">
				<view class="box">
					<image src="../../static/微信图片_20240805143422.jpg" mode=""></image>
				</view>
				<view class="box2">
					<text style="font-weight: 900;">东江湖风景区</text>
					<view>
						<text style="font-size: 10px;">长沙市宁乡县黄材镇黄材大道</text>
					</view>
					<view class="boxx">
						<text style="font-size: 12px;">自然风光</text>
					</view>
					<view class="">
						<text style="font-size: 10px;">据您2.1km</text>
					</view>
				</view>
			</view>
		</view>
	</scroll-view>
</template>

<script>
	export default {
		data() {
			return {
				city: '北京市',
				list3: [
					'https://cdn.uviewui.com/uview/swiper/swiper3.png',
					'https://cdn.uviewui.com/uview/swiper/swiper2.png',
					'https://cdn.uviewui.com/uview/swiper/swiper1.png',
				],
				list: [{
						name: 'photo',
						title: '附近厕所'
					},
					{
						name: 'lock',
						title: '实时天气'
					},
					{
						name: 'star',
						title: '周边美食'
					},
					{
						name: 'hourglass',
						title: '停车场'
					}
				],
			}
		},

		methods: {
			PagetoPrivate(){
			    uni.navigateTo({
			    	url:'/pages/index/private'
			    })	
			},
			pagetomap(){
				uni.navigateTo({
					url:'/pages/sousuo/map'
				})
			},
			scanCode() {
				uni.scanCode({
					success: (res) => {
						console.log(res.scanType)
						console.log(res.result)
						uni.navigateTo({
							url: 'http://code.yunchazs.com/5308240101031OMW.html'
						})
					}
				})
			},
			PagetoCity() {
				uni.navigateTo({
					url: '/pages/index/city'
				})
			},
			toSousuoPage() {
				uni.navigateTo({
					url: "/pages/sousuo/sousuo"
				})
			}
		}
	}
</script>

<style scoped lang="scss">
	.container {
		.list-jingdian {
			.boxx {
				margin-top: 20rpx;
				display: flex;
				justify-content: center;
				align-items: center;
				width: 140rpx;
				height: 40rpx;
				background-color: #F7F6FC;
				border: 2rpx solid black;
			}

			.box2 {
				margin-left: 30rpx;
				width: 340rpx;
				height: 200rpx;
			}

			.box {
				image {
					margin-left: 30rpx;
					width: 300rpx;
					height: 200rpx;
					border-radius: 20rpx;
				}
			}

			display: flex;
			align-items: center;
			margin: auto;
			margin-top: 20rpx;
			width: 680rpx;
			height: 260rpx;
			border-radius: 20rpx;
		}

		.jingdian {
			display: flex;
			justify-content: space-between;
			margin-top: 30rpx;

			.j-right {
				text {
					margin-left: 30rpx;
					font-size: 26rpx;
				}
			}
		}

		.swiper {
			margin-top: 30rpx;
		}

		.grid-text {
			font-size: 14px;
			color: #909399;
			padding: 10rpx 0 20rpx 0rpx;
			/* #ifndef APP-PLUS */
			box-sizing: border-box;
			/* #endif */
		}

		.second {
			.seach {
				.jinru {
					image {
						width: 70rpx;
						height: 70rpx;
					}

					display: flex;
					align-items: center;
					width: 540rpx;
					height: 100rpx;
					background-color: #F2F4F8;
					border-radius: 20rpx;
					margin-top: 30rpx;
				}

				display: flex;
				justify-content: center;
				margin-top: -60rpx;
				margin: auto;
				width: 680rpx;
				height: 210rpx;
				background-color: #fff;
				border-bottom-left-radius: 30rpx;
				border-bottom-right-radius: 30rpx;
			}

			.map {
				image {
					width: 80rpx;
					height: 80rpx;
				}

				display: flex;
				justify-content: center;
				align-items: center;
				margin: auto;
				background-color: #D7D7D7;
				margin-top: 10rpx;
				width: 680rpx;
				height: 210rpx;
				border-top-left-radius: 30rpx;
				border-top-right-radius: 30rpx;
			}
		}

		.my-heager {
			margin: auto;
			width: 680rpx;
			display: flex;
			justify-content: space-between;
			align-items: center;
			border-radius: 10rpx;

			.sao {
				image {
					width: 50rpx;
					height: 50rpx;
				}

				display:flex;
				justify-content: center;
				align-items: center;
				width: 66rpx;
				height: 66rpx;
				background-color: #fff;
				border-radius: 100rpx;
				border: 1px solid black;
			}

			.city {
				image {
					border-radius: 100rpx;
					width: 80rpx;
					height: 80rpx;

					&:last-child {
						width: 40rpx;
						height: 40rpx;
					}
				}

				text {
					margin-left: 20rpx;
				}

				display: flex;
				justify-content: space-between;
				align-items: center;
			}
		}

		// continar
		margin: auto;
		width: 90%;
		height: 1200px;
	}
</style>